@echo off
echo Initializing database...

REM 检查 MySQL 是否已安装
where mysql >nul 2>nul
if %errorlevel% neq 0 (
    echo Error: MySQL is not installed or not in PATH
    pause
    exit /b 1
)

REM 执行 SQL 脚本
mysql -u root -p < init.sql

if %errorlevel% neq 0 (
    echo Error: Failed to initialize database
    pause
    exit /b 1
)

echo Database initialized successfully!
pause 